In computer applications across the world, including search engines and other search sites (e.g. job searches, auto and home sales sites, dating sites, etc.), databases and the Structured Query Language (SQL) are used extensively to manage large volumes of relevant information. A database often contains one or more tables which contain rows (i.e. records) that store data. Each table is uniquely identified by a name and each row is typically uniquely identified by one or more identifiers. The table stores information about a class of data, for example the Person table will store the name and address of persons. A row in the address table stores a distinct instance of a person, like “President George W. Bush, 1600 Pennsylvania Ave NW, Washington D.C. 20500”. The tables are also organized into columns that uniquely describe a property of the data class the table is used to define. The Person table typically is organized using the columns ‘Name, Street Address, City, state and Zip’.
NameStreet AddressCityStateZipGeorge W Bush1600 PennsylvaniaWashingtonDC20500AveJohn Doe1 Main streetNew YorkNY10001Jane Doe10 Maple AveHollywoodCA90210
SQL Queries are used to effectively store and retrieve information from these tables. The SQL select statement is used extensively in computer applications to retrieve data from database tables. The SQL Select statement is used to select data from tables. It returns a result set which in turn is in the form of a table. The select statement is typically of the following form.                Select Column name [, column name . . . ]        From Table name        Where [Column name operator Value [and/or Column name operator Value]]        
In the above statements, everything between pairs of brackets (“[” and “]”) is optional. The Where clause in the SQL Select statement is used to specify a selection criterion, that filters the data that is selected from the table. Each Column name operator Value is a criterion condition that contributes as a sieve in the filtering of the data to be returned in the result set.
For example, using the example Person table shown above, the following SQL Select statement                Select Name        From Person        Where STATE=‘NY’ or STATE=‘CA’        
Will return the following values from the above table:
NameJohn DoeJane Doe
In this example the first record is not returned because the value for STATE in the record did not match either of the conditions and therefore does not filter through.
The following are valid operators allowed per SQL standards.
OperatorDescription=Equal< >Not equal>Greater than<Less than>=Greater than or equal<=Less than or equalBETWEENBetween an inclusive rangeLIKESearch for a pattern
The Boolean operators ‘AND’ and ‘OR’ are used in where clauses to connect simple conditions to make compound conditions. The ‘AND’ operator returns rows that match all the conditions connected by it. The ‘OR’ operator returns rows that match any one of the conditions connected by it.
These types of SQL queries are extremely prevalent in computer applications across the world. One common area where the end user input is translated into SQL queries is in classified searches on the internet. An example of this is found in online job portals, where Job seekers can search for Job Listings by inputting the search criteria in a search form. The site then returns all the Job Listings that match the inputted criteria. In this scenario the criteria input by the user in the search form is translated into a SQL query and executed. The result set returned by the query is then formatted and displayed back to the user.
There are inherent deficiencies in this approach. The search, as well as the underlying SQL query returns a point-in-time snapshot of the results. Meanwhile, the data that is being searched is continuously updated. This results in a situation where there is a need for the search function to be performed multiple times and this is accomplished by re-executing the SQL Query. In the Job Search example either the Job seeker has to intermittently re-submit the search or the SQL query has to be re-executed intermittently. The first option causes inconvenience to the user and both the options are expensive in terms of computational resources.
It would be desirable for the user that is performing the search to save the search and for the application to notify the user whenever any new data that matches the search gets added to the database. Most of the current applications lack this feature and the few applications that support this feature use the technique of performing the SQL queries multiple times on an intermittent basis. While this expensive option avoids the need for the user to re-submit the search intermittently and frequently, in cases where time is of the essence the user does not get notified as soon as a matching record is added.